<?php
/**
 * Created by Engineer CuiLiwu.
 * Project: deal.
 * Date: 2018/6/12-14:59
 * License Hangzhou orce Technology Co., Ltd. Copyright © 2018
 */

namespace App\Http\Middleware;
use Closure;
use Tymon\JWTAuth\Middleware\BaseMiddleware;

class CORS  extends BaseMiddleware
{
    public function handle($request, Closure $next)
    {
        return $next($request)->header('Access-Control-Allow-Origin', '*')
            ->header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT, DELETE')->header('Access-Control-Allow-Credentials', true);
    }
}